<template>
    <div style="width: 100% ;text-align: right">
        <el-button class="el-button--primary" @click="submit">保存</el-button>
        <el-button class="el-button--primary" @click="cancel ">取消</el-button>
    </div>
</template>
<script>

    export default {
        name: 'SubmitButton',
        props: {
            saveUrl: String,
            updateUrl: String,
        },
        methods: {
            submit() {
                let parent = this.$parent;
                while (parent.dialogTableVisible == undefined) {
                    parent = parent.$parent;
                }
                //TODO
                //提交信息
                const form = parent.form;
                //更新,Id不为空
                if (form.id) {
                    //TODO
                } else {
                    //TODO
                }
            },
            cancel() {
                let parent = this.$parent;
                while (parent.dialogTableVisible == undefined) {
                    parent = parent.$parent;
                }
                parent.dialogTableVisible = false
            }
        }
    }

</script>

